from apps.meiduo_admin.utils import PageNum
from rest_framework.viewsets import ModelViewSet
from django.contrib.auth.models import Group,Permission
from apps.meiduo_admin.serializers.group import GroupSerializer,PermissionSerializer
from rest_framework.generics import ListAPIView


class GroupModelViewSet(ModelViewSet):
    queryset = Group.objects.all().order_by('id')
    serializer_class = GroupSerializer
    pagination_class = PageNum


class PermissionListAPIView(ListAPIView):
    queryset = Permission.objects.all()
    serializer_class = PermissionSerializer